package com.zdp.degisn.pipe_filter.selector.impl;

import com.zdp.degisn.pipe_filter.filter.Filter;
import com.zdp.degisn.pipe_filter.selector.Selector;

import java.util.HashSet;
import java.util.Set;

/**
 * @author zhengdp
 * @Description 跳过学生前置处理
 * @Date 2022/9/6 23:23
 * @Created by zhengdp
 */
public class SickSkipStudentSelectorImpl implements Selector {

    private SickSkipStudentSelectorImpl(){}

    @Override
    public boolean match(Filter filter) {
        return filterSets.contains(filter.getFilterName());
    }

    private static class SickSkipStudentSelectorImplSingle{
        private static final SickSkipStudentSelectorImpl instance = new SickSkipStudentSelectorImpl();
    }

    private final Set<String> filterSets;
    {
        filterSets = new HashSet<>();
        filterSets.add("TeacherFilter");
    }

    public static SickSkipStudentSelectorImpl instance(){
        return SickSkipStudentSelectorImpl.SickSkipStudentSelectorImplSingle.instance;
    }
}
